﻿using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using ChEngine;

namespace TestGen
{
    [TestFixture]
    public class LongTimeRunning
    {
        [Test]
        public void HugePerftTest()
        {
            ICollection<PerftTestItem> item = PerftTestSuite.GetAll();
            foreach (PerftTestItem pti in item)
            {
                ChessBoard board = new ChessBoard(pti.Fen);
                Console.WriteLine("Testing fen:" + pti.Fen);
                board.Dump(Console.Out);
                foreach (PerftExpectation pe in pti.Expectations)
                {
                    PerfResults res = board.Perft(pe.Depth);
                    Console.WriteLine("Depth={0} Moves = {1} Elapsed = {2} {3} mps",pe.Depth,res.MovesCount,res.Elapsed,(res.MovesCount/(double)res.Elapsed)*1000.0);
                    Assert.AreEqual(pe.Count, res.MovesCount);
                }
            }
        }
    }
}
